import { ref, watch, computed } from 'vue'
import { usePackagesStore } from '@/store/modules/packageStore/index'
// 图表
export type MenuOptionsType = {
  key: string
  // icon: ReturnType<typeof renderIcon>
  // label: ReturnType<typeof renderLang>
  // list: ConfigType[]
}
export const useAsideHook = () => {
  const packagesStore = usePackagesStore()
  const menuOptions: MenuOptionsType[] = []
  // 处理列表
  const handlePackagesList = () => {
    for (const val in packagesStore.getPackagesList) {
      menuOptions.push({
        key: val,
        // @ts-ignore
        icon: '',
        // @ts-ignore
        label: '',
        // @ts-ignore
        list: packagesStore.getPackagesList[val]
      })
    }
  }
  handlePackagesList()
    // 选中的对象值
  const selectOptions = ref(menuOptions[0])
  return {
    menuOptions,
    selectOptions
  }
}